<?php
class Control_Game_uploadExcel {

	function uploadExcel() {
		if(!$_FILES) {
			MooView::render('uploadFiles');
			exit;
		}
		$fileName = "loginIds.xls";
		if ($_FILES["file"]["name"] != $fileName) {
			$message = "文件名错误!,请上传" . $fileName;
			MooView::set('message', $message);
			MooView::render('uploadFiles');
			exit;
		}
		
		$path =  ROOT_PATH.'/www/loginIds.xls';
		if(move_uploaded_file($_FILES["file"]["tmp_name"], $path)) {
			$message = "上传".$fileName."成功!";
			MooView::set('message', $message);
			MooView::render('uploadFiles');
		} else {
			$message = "上传".$fileName."失败!";
			MooView::set('message', $message);
			MooView::render('uploadFiles');
		}
	}
}